package org.xjc.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xjc.annotation.Error;
import org.xjc.entity.ErrorLog;
import org.xjc.mapper.ErrorLogMapper;

import javax.annotation.Resource;

/**
 * @Author : XJC
 * @Description :错误日志log
 * @create : 2022/8/3 15:32
 */
@RestController()
@RequestMapping("/api/error/")
public class ErrorLogController {

    @Resource
    ErrorLogMapper errorLogMapper;

    @PostMapping("test")
    @Error
    public Object test(){
//        throw new RuntimeException("test");
        return null;
    }

    @PostMapping("queryAllErrorLog")
    @Error
    public Object queryAllErrorLog(){
        return errorLogMapper.selectList(new QueryWrapper<ErrorLog>().eq("ISDELETED",0));
    }


}
